Integrand size = 27, antiderivative size = 120 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f} \]
[Out]
Time = 0.08 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 45} \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {(f x+g)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}+\frac {b n (d f-e g)^3 \log (d+e x)}{3 e^3 f}-\frac {b n x (d f-e g)^2}{3 e^2}+\frac {b n (f x+g)^2 (d f-e g)}{6 e f}-\frac {b n (f x+g)^3}{9 f} \]
[In]
[Out]
Rule 45
Rule 2442
Rule 2459
Rubi steps \begin{align*} \text {integral}& = \int (g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx \\ & = \frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \frac {(g+f x)^3}{d+e x} \, dx}{3 f} \\ & = \frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \left (\frac {f (-d f+e g)^2}{e^3}+\frac {(-d f+e g)^3}{e^3 (d+e x)}+\frac {f (-d f+e g) (g+f x)}{e^2}+\frac {f (g+f x)^2}{e}\right ) \, dx}{3 f} \\ & = -\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f} \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.25 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {6 b d^2 f (d f-3 e g) n \log (d+e x)+e \left (x \left (6 a e^2 \left (3 g^2+3 f g x+f^2 x^2\right )-b n \left (6 d^2 f^2-3 d e f (6 g+f x)+e^2 \left (18 g^2+9 f g x+2 f^2 x^2\right )\right )\right )+6 b e \left (3 d g^2+e x \left (3 g^2+3 f g x+f^2 x^2\right )\right ) \log \left (c (d+e x)^n\right )\right )}{18 e^3} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(264\) vs. \(2(110)=220\).
Time = 0.46 (sec) , antiderivative size = 265, normalized size of antiderivative = 2.21
method | result | size |
parallelrisch | \(\frac {6 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} f^{2}-2 x^{3} b d \,e^{3} f^{2} n +6 x^{3} a d \,e^{3} f^{2}+18 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} f g +3 x^{2} b \,d^{2} e^{2} f^{2} n -9 x^{2} b d \,e^{3} f g n +6 \ln \left (e x +d \right ) b \,d^{4} f^{2} n -18 \ln \left (e x +d \right ) b \,d^{3} e f g n +36 \ln \left (e x +d \right ) b \,d^{2} e^{2} g^{2} n +18 x^{2} a d \,e^{3} f g +18 x \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} g^{2}-6 x b \,d^{3} e \,f^{2} n +18 x b \,d^{2} e^{2} f g n -18 x b d \,e^{3} g^{2} n +18 x a d \,e^{3} g^{2}-18 \ln \left (c \left (e x +d \right )^{n}\right ) b \,d^{2} e^{2} g^{2}}{18 d \,e^{3}}\) | \(265\) |
risch | \(-\frac {f \ln \left (e x +d \right ) b \,d^{2} g n}{e^{2}}-\frac {f b g n \,x^{2}}{2}-\frac {f^{2} b \,d^{2} n x}{3 e^{2}}+\frac {f^{2} \ln \left (e x +d \right ) b \,d^{3} n}{3 e^{3}}-\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{6}+\frac {a \,f^{2} x^{3}}{3}+a \,g^{2} x +\ln \left (c \right ) b \,g^{2} x +\frac {f^{2} \ln \left (c \right ) b \,x^{3}}{3}-\frac {i \pi b \,g^{2} x \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}-b \,g^{2} n x +\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}+\frac {b \,g^{2} n d \ln \left (e x +d \right )}{e}+\frac {\left (f x +g \right )^{3} b \ln \left (\left (e x +d \right )^{n}\right )}{3 f}-\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}+\frac {f^{2} b d n \,x^{2}}{6 e}-\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{6}+\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {f^{2} b n \,x^{3}}{9}+f a g \,x^{2}-\frac {\ln \left (e x +d \right ) b \,g^{3} n}{3 f}+f \ln \left (c \right ) b g \,x^{2}-\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {f x b d n g}{e}+\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}\) | \(585\) |
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.82 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-\frac {2 \, {\left (b e^{3} f^{2} n - 3 \, a e^{3} f^{2}\right )} x^{3} - 3 \, {\left (6 \, a e^{3} f g + {\left (b d e^{2} f^{2} - 3 \, b e^{3} f g\right )} n\right )} x^{2} - 6 \, {\left (3 \, a e^{3} g^{2} - {\left (b d^{2} e f^{2} - 3 \, b d e^{2} f g + 3 \, b e^{3} g^{2}\right )} n\right )} x - 6 \, {\left (b e^{3} f^{2} n x^{3} + 3 \, b e^{3} f g n x^{2} + 3 \, b e^{3} g^{2} n x + {\left (b d^{3} f^{2} - 3 \, b d^{2} e f g + 3 \, b d e^{2} g^{2}\right )} n\right )} \log \left (e x + d\right ) - 6 \, {\left (b e^{3} f^{2} x^{3} + 3 \, b e^{3} f g x^{2} + 3 \, b e^{3} g^{2} x\right )} \log \left (c\right )}{18 \, e^{3}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (102) = 204\).
Time = 4.50 (sec) , antiderivative size = 252, normalized size of antiderivative = 2.10 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\begin {cases} \frac {a f^{2} x^{3}}{3} + a f g x^{2} + a g^{2} x + \frac {b d^{3} f^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {b d^{2} f^{2} n x}{3 e^{2}} - \frac {b d^{2} f g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} + \frac {b d f^{2} n x^{2}}{6 e} + \frac {b d f g n x}{e} + \frac {b d g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f^{2} n x^{3}}{9} + \frac {b f^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} - \frac {b f g n x^{2}}{2} + b f g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} - b g^{2} n x + b g^{2} x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f^{2} x^{3}}{3} + f g x^{2} + g^{2} x\right ) & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.56 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {1}{3} \, b f^{2} x^{3} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {1}{3} \, a f^{2} x^{3} - b e g^{2} n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} + \frac {1}{18} \, b e f^{2} n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} - \frac {1}{2} \, b e f g n {\left (\frac {2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac {e x^{2} - 2 \, d x}{e^{2}}\right )} + b f g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + a f g x^{2} + b g^{2} x \log \left ({\left (e x + d\right )}^{n} c\right ) + a g^{2} x \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 424 vs. \(2 (110) = 220\).
Time = 0.31 (sec) , antiderivative size = 424, normalized size of antiderivative = 3.53 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {{\left (e x + d\right )}^{3} b f^{2} n \log \left (e x + d\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f^{2} n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f^{2} n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{2} b f g n \log \left (e x + d\right )}{e^{2}} - \frac {2 \, {\left (e x + d\right )} b d f g n \log \left (e x + d\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g^{2} n \log \left (e x + d\right )}{e} - \frac {{\left (e x + d\right )}^{3} b f^{2} n}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} b d f^{2} n}{2 \, e^{3}} - \frac {{\left (e x + d\right )} b d^{2} f^{2} n}{e^{3}} - \frac {{\left (e x + d\right )}^{2} b f g n}{2 \, e^{2}} + \frac {2 \, {\left (e x + d\right )} b d f g n}{e^{2}} - \frac {{\left (e x + d\right )} b g^{2} n}{e} + \frac {{\left (e x + d\right )}^{3} b f^{2} \log \left (c\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f^{2} \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f^{2} \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{2} b f g \log \left (c\right )}{e^{2}} - \frac {2 \, {\left (e x + d\right )} b d f g \log \left (c\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g^{2} \log \left (c\right )}{e} + \frac {{\left (e x + d\right )}^{3} a f^{2}}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} a d f^{2}}{e^{3}} + \frac {{\left (e x + d\right )} a d^{2} f^{2}}{e^{3}} + \frac {{\left (e x + d\right )}^{2} a f g}{e^{2}} - \frac {2 \, {\left (e x + d\right )} a d f g}{e^{2}} + \frac {{\left (e x + d\right )} a g^{2}}{e} \]
[In]
[Out]
Time = 1.29 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.77 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=x^2\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{2\,e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{6\,e}\right )+x\,\left (\frac {3\,a\,e\,g^2-3\,b\,e\,g^2\,n+6\,a\,d\,f\,g}{3\,e}-\frac {d\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{3\,e}\right )}{e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f^2\,x^3}{3}+b\,f\,g\,x^2+b\,g^2\,x\right )+\frac {f^2\,x^3\,\left (3\,a-b\,n\right )}{9}+\frac {\ln \left (d+e\,x\right )\,\left (b\,n\,d^3\,f^2-3\,b\,n\,d^2\,e\,f\,g+3\,b\,n\,d\,e^2\,g^2\right )}{3\,e^3} \]
[In]
[Out]